Skip to content

Allow use of a custom startup file #353

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 10, 2018
Merged

Conversation

fpistm
Copy link
Member

@fpistm fpistm commented Oct 9, 2018

Syntax in the board.txt:
xxx.build.startup_file=-DCUSTOM_STARTUP_FILE

Example to use a custom startup file for Nucleo_L476RG:
Nucleo_64.menu.pnum.NUCLEO_L476RG.build.startup_file=-DCUSTOM_STARTUP_FILE
Then add a "*.S" file in the "variant/NUCLEO_L476RG/" folder
Important note: extension must be '.S' not '.s'

CUSTOM_STARTUP_FILE could also be defined thanks the build_opt.h.
CMSIS_STARTUP_FILE could now be overridden using the build_opt.h, ex:
-DCMSIS_STARTUP_FILE=\"startup_stm32l476xx.s\"

Fix #352

Syntax in the board.txt:
xxx.build.startup_file=-DCUSTOM_STARTUP_FILE

Example to use a custom startup file for Nucleo_L476RG:
    Nucleo_64.menu.pnum.NUCLEO_L476RG.build.startup_file=-DCUSTOM_STARTUP_FILE
Then add a "*.S" file in the "variant/NUCLEO_L476RG/" folder
Important note: extension must be '.S' not '.s'

CUSTOM_STARTUP_FILE could also be defined thanks the build_opt.h.
CMSIS_STARTUP_FILE could now be overridden using the build_opt.h, ex:
-DCMSIS_STARTUP_FILE=\"startup_stm32l476xx.s\"


Signed-off-by: Frederic.Pillon <[email protected]>
@fpistm fpistm added the enhancement New feature or request label Oct 9, 2018
@fpistm fpistm self-assigned this Oct 9, 2018
Copy link
Contributor

@xC0000005 xC0000005 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This solution works perfectly well for what I need. I do have one question - how would a board set its startup file in the boards.txt? Is there an example?

@xC0000005
Copy link
Contributor

I see now how to set it. Thanks.

@fpistm fpistm added this to the 1.4.0 milestone Oct 10, 2018
@fpistm fpistm merged commit 182fdf4 into stm32duino:master Oct 10, 2018
@fpistm fpistm deleted the custom_startup branch October 10, 2018 07:22
benwaffle pushed a commit to benwaffle/Arduino_Core_STM32 that referenced this pull request Apr 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants